FIND_PATH(GIFTI_INCLUDE_DIR gifti_io.h /usr/include /usr/local/include )

FIND_LIBRARY(GIFTI_LIBRARY NAMES giftiio PATHS /usr/lib /usr/local/lib )

IF (GIFTI_INCLUDE_DIR AND GIFTI_LIBRARY)
   SET(GIFTI_FOUND TRUE)
ENDIF (GIFTI_INCLUDE_DIR AND GIFTI_LIBRARY)


IF (GIFTI_FOUND)
   IF (NOT GIFTI_FIND_QUIETLY)
      MESSAGE(STATUS "Found GIfTI headers: ${GIFTI_INCLUDE_DIR}")
      MESSAGE(STATUS "Found GIfTI library: ${GIFTI_LIBRARY}")
   ENDIF (NOT GIFTI_FIND_QUIETLY)
ELSE (GIFTI_FOUND)
   IF (GIFTI_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Cound not find GIfTI")
   ENDIF (GIFTI_FIND_REQUIRED)
ENDIF (GIFTI_FOUND)
